/* Copyright 2022 The TensorFlow Authors. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/

#ifndef PERIPHERALS_AUDIO_CODEC_H_
#define PERIPHERALS_AUDIO_CODEC_H_

#include "audio_common.h"

namespace peripherals {

class IAudioCodec {
 public:
  virtual AudioConfiguration GetCurrentConfiguration() const = 0;
  virtual bool SetCurrentConfiguration(const AudioConfiguration& config) = 0;

  virtual void Mute(const AudioFunction which, const bool enable) = 0;
  virtual void Start(const AudioFunction which) = 0;
  virtual void Stop(const AudioFunction which) = 0;
  virtual void SetVolume(const AudioFunction which, const float percent) = 0;

  virtual bool HasSampleRate(const AudioFunction which,
                             const AudioSampleRate rate) const = 0;
  virtual bool HasChannelConfig(const AudioChannelConfig channel) const = 0;
  virtual bool HasFunction(const AudioFunction which) const = 0;
  virtual bool HasSampleWidth(const AudioSampleWidth width) const = 0;
  virtual bool HasSimultaneousPlayRecord() const = 0;
  virtual bool HasVolume(const AudioFunction which) const = 0;
  virtual bool HasMute(const AudioFunction which) const = 0;
};

}  // namespace peripherals

#endif  // PERIPHERALS_AUDIO_CODEC_H_
